﻿using Avalonia.Media;

namespace ExcelMerge;

public class CellData
{
    public string Value { get; }
    public bool IsLineNumber { get; }
    public IBrush Color { get; } = new SolidColorBrush(Colors.White);
    private CellDiffItem _cellItem;
    public CellData(CellDiffItem cell)
    {
        Value = cell.Value;
        _cellItem = cell;
        switch (cell.PatchedState)
        {
            case PatchState.Insert:
                Color = new SolidColorBrush(Colors.DarkGreen);
                break;
            case PatchState.Change:
                Color = new SolidColorBrush(Colors.DarkGoldenrod);
                break;
            case PatchState.Delete:
                Color = new SolidColorBrush(Colors.DarkGray);
                break;
            default:
                Color = new SolidColorBrush(Colors.White);
                break;
        }
    }

    public CellData(int line)
    {
        Value = line.ToString();
        IsLineNumber = true;
    }
}